﻿<UserControl x:Class="Rifts.Controls.CharacterSheet"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:controls="clr-namespace:Rifts.Controls"
			 mc:Ignorable="d" 
			 d:DesignHeight="300" d:DesignWidth="300">
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Granite.Xaml;component/ConvertersList.xaml" />
				<ResourceDictionary Source="/Assets/Styles.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>

	<StackPanel Orientation="Horizontal">
		<StackPanel Name="LeftStack">

			<Border Margin="8" Padding="4" BorderThickness="1" BorderBrush="Black">
				<StackPanel >
					<TextBlock Text="Rifts" HorizontalAlignment="Center" />
					<controls:LabeledTextBlock Header="Race:" Text="{Binding Race}" Visibility="{Binding Race, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<TextBlock Text="{Binding RaceReference}" Visibility="{Binding RaceReference, Converter={StaticResource NotZeroToVisibleConverter}}"  FontStyle="Italic" />
					<controls:LabeledTextBlock Header="Class:" Text="{Binding Class}" Visibility="{Binding Class, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<TextBlock Text="{Binding ClassReference}" Visibility="{Binding ClassReference, Converter={StaticResource NotZeroToVisibleConverter}}"  FontStyle="Italic" />

				</StackPanel>
			</Border>

			<Border Margin="8" Padding="4" BorderThickness="1" BorderBrush="Black">
				<StackPanel >
					<TextBlock Text="Attributes" HorizontalAlignment="Center" />
					<controls:LabeledTextBlock Header="IQ:" Text="{Binding IQ}" Visibility="{Binding IQ, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="ME:" Text="{Binding ME}" Visibility="{Binding ME, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="MA:" Text="{Binding MA}" Visibility="{Binding MA, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="PS:" Text="{Binding PS}" Visibility="{Binding PS, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="PP:" Text="{Binding PP}" Visibility="{Binding PP, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="PE:" Text="{Binding PE}" Visibility="{Binding PE, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="Spd:" Text="{Binding Spd}" Visibility="{Binding Spd, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="Flying Spd:" Text="{Binding FlyingSpd}" Visibility="{Binding FlyingSpd, Converter={StaticResource NotNullToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="Perception:" Text="{Binding Perception, StringFormat=+{0}}" Visibility="{Binding Perception, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="Horror Factor:" Text="{Binding HF}" Visibility="{Binding HF, Converter={StaticResource NotZeroToVisibleConverter}}" />
				</StackPanel>
			</Border>
			<Border  Margin="8" Padding="4" BorderThickness="1" BorderBrush="Black">
				<StackPanel>
					<TextBlock Text="Magic &amp; Psionics" HorizontalAlignment="Center" />
					<controls:LabeledTextBlock Header="PPE:" Text="{Binding Ppe}" Visibility="{Binding Ppe, Converter={StaticResource NotNullToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="ISP:" Text="{Binding Isp}" Visibility="{Binding Isp, Converter={StaticResource NotZeroToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="Spell Strength:" Text="{Binding SpellStrength}" Visibility="{Binding SpellStrength, Converter={StaticResource NotZeroToVisibleConverter}}"/>
				</StackPanel>
			</Border>
			<!--</StackPanel>
		
		<StackPanel Name="MiddleStack" >-->
			<Border  Margin="8" Padding="4" BorderThickness="1" BorderBrush="Black">
				<StackPanel>
					<TextBlock Text="Combat Stats" HorizontalAlignment="Center" />
					<controls:LabeledTextBlock Header="MDC:" Text="{Binding MDC}" Visibility="{Binding MDC, Converter={StaticResource NotNullToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="SDC:" Text="{Binding SDC}" Visibility="{Binding SDC, Converter={StaticResource NotNullToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="HP:" Text="{Binding HP}" Visibility="{Binding SDC, Converter={StaticResource NotNullToVisibleConverter}}"/>
					<controls:LabeledTextBlock Header="Attacks:" Text="{Binding Attacks}" />
					<controls:LabeledTextBlock Header="Actions:" Text="{Binding Actions}" Visibility="{Binding Actions, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="Initiative:" Text="{Binding Initiative, StringFormat=+{0}}" Visibility="{Binding Perception, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="Strike:" Text="{Binding Strike, StringFormat=+{0}}" Visibility="{Binding Strike, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="Parry:" Text="{Binding Parry, StringFormat=+{0}}" Visibility="{Binding Parry, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="Dodge:" Text="{Binding Dodge, StringFormat=+{0}}" Visibility="{Binding Dodge, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="PullPunch:" Text="{Binding PullPunch, StringFormat=+{0}}" Visibility="{Binding PullPunch, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="Roll with Punch/Impact:" Text="{Binding Roll, StringFormat=+{0}}" Visibility="{Binding Roll, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="Entangle:" Text="{Binding Entangle, StringFormat=+{0}}" Visibility="{Binding Entangle, Converter={StaticResource NotZeroToVisibleConverter}}" />
				</StackPanel>
			</Border>



			<Border  Margin="8" Padding="4" BorderThickness="1" BorderBrush="Black">
				<StackPanel>
					<TextBlock Text="Saving Throws" HorizontalAlignment="Center" />
					<StackPanel Visibility="{Binding SaveBase, Converter={StaticResource NotZeroToVisibleConverter}}">
						<controls:LabeledTextBlock Header="All Saves:" Text="{Binding SaveBase, StringFormat=+{0}}" />
						<TextBlock FontStyle="Italic"  Text="(This bonus is added to all saves)" />
					</StackPanel>
					<controls:LabeledTextBlock Header="vs Horror:" Text="{Binding SaveHorror, StringFormat=+{0}}" Visibility="{Binding SaveHorror, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="vs Psionics:" Text="{Binding SavePsionic, StringFormat=+{0}}" Visibility="{Binding SavePsionic, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="vs Mind Control:" Text="{Binding SaveMindControl, StringFormat=+{0}}" Visibility="{Binding SaveMindControl, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="vs Magic:" Text="{Binding SaveMagic, StringFormat=+{0}}" Visibility="{Binding SaveMagic, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="vs Possession:" Text="{Binding SavePossession, StringFormat=+{0}}" Visibility="{Binding SavePossession, Converter={StaticResource NotZeroToVisibleConverter}}" />
					<controls:LabeledTextBlock Header="vs Illusions:" Text="{Binding SaveIllusions, StringFormat=+{0}}" Visibility="{Binding SaveIllusions, Converter={StaticResource NotZeroToVisibleConverter}}" />




				</StackPanel>
			</Border>

		</StackPanel>
		<StackPanel Name="RightStack" >

			<Border  Margin="8" Padding="4" BorderThickness="1" BorderBrush="Black">
				<StackPanel>
					<TextBlock Text="Skills" HorizontalAlignment="Center" />
					<ItemsControl ItemsSource="{Binding Skills}">
						<ItemsControl.ItemTemplate>
							<DataTemplate>
								<StackPanel Orientation="Horizontal" >
									<TextBlock Text="{Binding Name}" />
									<TextBlock Text="{Binding Score, StringFormat={} {0}%}" Visibility="{Binding Score, Converter={StaticResource NotZeroToVisibleConverter}}" />
									<TextBlock Text="{Binding SecondaryScore, StringFormat={}\/{0}%}" 
											   Visibility="{Binding SecondaryScore, Converter={StaticResource NotZeroToVisibleConverter}}" />
									<TextBlock Text="{Binding PerLevel, StringFormat={} +{0}\/level}" Visibility="{Binding PerLevel, Converter={StaticResource NotZeroToVisibleConverter}}"/>
								</StackPanel>
							</DataTemplate>
						</ItemsControl.ItemTemplate>
					</ItemsControl>
				</StackPanel>
			</Border>

			<Border  Margin="8" Padding="4" BorderThickness="1" BorderBrush="Black">
				<StackPanel>
					<TextBlock Text="Abilities" HorizontalAlignment="Center" />
					<ItemsControl ItemsSource="{Binding Abilities}">
						<ItemsControl.ItemTemplate>
							<DataTemplate>
								<StackPanel Orientation="Horizontal" >
									<TextBlock Text="{Binding Name}" />
									<TextBlock Text="{Binding Score, StringFormat={} {0}%}" 
											   Visibility="{Binding Score, Converter={StaticResource NotZeroToVisibleConverter}}" />
									<TextBlock Text="{Binding PerLevel, StringFormat={} +{0}\/level}" 
											   Visibility="{Binding PerLevel, Converter={StaticResource NotZeroToVisibleConverter}}"/>
								</StackPanel>
							</DataTemplate>
						</ItemsControl.ItemTemplate>
					</ItemsControl>
				</StackPanel>
			</Border>


		</StackPanel>
	</StackPanel>

</UserControl>
